﻿CREATE TABLE [Reporting].[LogInfo]
(
	[LogID] BIGINT IDENTITY(1,1) NOT NULL CONSTRAINT [REPORTING_LogInfo_LogID] PRIMARY KEY,
	[LogType] NVARCHAR(250) NOT NULL CONSTRAINT [FK_LogInfo_TO_LogType_ON_Enum] FOREIGN KEY ([LogType]) REFERENCES [Reporting].[LogType]([Enum]),
	[TableName] NVARCHAR(50) NOT NULL CONSTRAINT [REPORTING_LogInfo_TableName] DEFAULT ('UNKNOWN'),
	[Metadata] XML NOT NULL CONSTRAINT [REPORTING_LogInfo_Metadata] DEFAULT ('NONE'),
	[CreatedBy] NVARCHAR(250) NOT NULL CONSTRAINT [REPORTING_LogInfo_CreatedBy] DEFAULT SYSTEM_USER,	
	[DateCreated] DATETIME NOT NULL CONSTRAINT [REPORTING_LogInfo_DateCreated] DEFAULT GETDATE(), 
	[DateDeleted] DATETIME NULL,
	[VersionUser] NVARCHAR(250) NOT NULL CONSTRAINT [REPORTING_LogInfo_VersionUser] DEFAULT SYSTEM_USER,
	[VersionDate] DATETIME NOT NULL CONSTRAINT [REPORTING_LogInfo_VersionDate] DEFAULT GETDATE()
)
